/*
 * Write a C++ program to evaluate 1 + 3 + 5 + ..... + N
 */

# include <iostream>
using namespace std;

class OddSeries {
  int n;
public:
  void printSeries();
};

void OddSeries::printSeries() {
  int i, j = 0;
  cout << "Enter the maximum number for series: ";
  cin >> n;
  for(i = 1; i <= n; i += 2) {
    if( i == 1) {
      cout << i;
    }
    else {
      cout << " + " << i;
    }
    j += i;
  }
  cout << " = " << j << endl;
}

int main() {
  OddSeries os;
  os.printSeries();
  return 0;
}
